package com.yuanfeng.goods.controller;

import com.yuanfeng.commoms.annnotation.Log;
import com.yuanfeng.commoms.util.ResponseResult;
import com.yuanfeng.goods.dto.ManageSpecValueDTO;
import com.yuanfeng.goods.dto.ManageSpecValueQueryDTO;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName GoodsSpecValueController
 * @Description 商品规格值
 * @Author cf
 * @Date 2023/6/27 17:27
 * @Version 1.0
 */
@RestController
@RequestMapping("/goods/spec/value")
public class GoodsSpecValueController extends BaseController{

    /**
     * 更新店铺规格
     *
     * @param param
     * @return
     */
    @Log("更新店铺规格")
    @PostMapping("/add")
    public ResponseResult updateBySpecId(@RequestBody ManageSpecValueDTO param) {
        ResponseResult result = goodsSpecValueService.updateBySpecId(param);
        return result;
    }

    /**
     * 获取规格列表
     * @param param
     * @return
     */
    @PostMapping("/spec/list/query")
    public ResponseResult queryGoodsSpecByCatId(@RequestBody ManageSpecValueQueryDTO param) {
        ResponseResult result = goodsSpecValueService.queryGoodsSpecByCatId(param);
        return result;
    }


    /**
     * 查询店铺规格
     *
     * @param param
     * @return
     */
    @PostMapping("/specsvalue/query")
    public ResponseResult queryShopSpecs(@RequestBody ManageSpecValueQueryDTO param) {
        ResponseResult result = goodsSpecValueService.queryShopSpecs(param);
        return result;
    }
}
